package de.iritgo.skillfull.collision;

import de.iritgo.skillfull.entity.Entity;
import de.iritgo.skillfull.event.BasicEvent;
import de.iritgo.skillfull.event.Event;
import de.iritgo.skillfull.event.EventService.EVENT_TYPE;

/**
 * If a entity collision is detected the collision manager fire up this event.
 * You get both entities them have collided.
 * 
 * @author held
 */
public class CollisionEvent extends BasicEvent implements Event 
{
	private Entity entity1;
	private Entity entity2;

	/**
	 * The default constructor
	 * 
	 * @param entity1 The first entity of the collision
	 * @param entity2 The second entity of the collision
	 */
	public CollisionEvent (Entity entity1, Entity entity2) 
	{
		eventType = EVENT_TYPE.COLLISION;
		
		this.entity1 = entity1;
		this.entity2 = entity2;
	}

	/**
	 * Get the first entity
	 * 
	 * @return The first entity
	 */
	public Entity getEntity1 () 
	{
		return entity1;
	}

	/**
	 * Get the second entity
	 * 
	 * @return The second entity
	 */
	public Entity getEntity2 () 
	{
		return entity2;
	}
}
